﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "IObject.h"
#include "NotificationTypes_gen.h"
#include "GcmpModelInterface.h"
#include "INotificationDetailItem.h"

namespace gcmp
{

    /// \brief 弱提示的接口类
    ///
    /// 提供了获取弱提示类型、获取弱提示文本内容、获取弱提示详细信息项的接口
    class GCMP_MODEL_INTERFACE_EXPORT INotification : public IObject
    {
        DEFINE_CAST_DERIVED(gcmp::INotification, gcmp::IObject);
    public:

        /// \brief 根据给定数据创建新的弱提示
        /// \param type             提示类型
        /// \param text             提示文本内容
        /// \param detailItems      提示的详细信息项
        /// \return 返回新创建的INotification对象，创建失败则返回空。
        static OwnerPtr<INotification> CreateNotification(NotificationTypes type, const std::wstring& text,
            std::vector<OwnerPtr<INotificationDetailItem>> detailItems );

        /// \brief 获取弱提示类型，目前有成功、警告、信息三种
        /// \return 返回弱提示类型
        virtual NotificationTypes GetType() const = 0;

        /// \brief 获取弱提示的文本内容
        /// \return 返回弱提示的文本内容
        virtual const std::wstring& GetText() const = 0;

        /// \brief 获取弱提示的所有详细信息项
        /// \return 返回弱提示的所有详细信息项
        virtual const std::vector<OwnerPtr<INotificationDetailItem>>& GetDetailItems() const = 0;
    };
}



